package com.find.answer.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.find.answer.domain.po.User;
import com.find.answer.mapper.UserMapper;
import com.find.answer.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @author Seon
 * @date 2022/11/1 21:10
 */
@Service
public class UserServiceImpl
        extends ServiceImpl<UserMapper, User> implements UserService {
    @Override
    public boolean userCheck(String phone) {
        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(User::getPhone, phone);
        int count = this.count(wrapper);
        return count > 0;
    }
}
